******************************************************************************************************************************
***  PROJECT:  "Language Heightens the Political Salience of Ethnic Divisions", Journal of Experimental Political Science
***  AUTHORS:	Efren O. Perez and Margit Tavits
***  CONTENT: 	Description of replication materials
***  DATE: 	June 6, 2018
******************************************************************************************************************************

All data analyses were carried out using Stata/SE 14.2 for Mac (64-bit Intel).

1. Files

Study1_raw.dta - Raw data for Study 1
Study1_analysis.do - Code to set up the analysis dataset for Study 1 and run the analyses reported in the manuscript and the SI.

Study2_raw.dta - Raw data for Study 2
Study2_analysis.do - Code to set up the analysis dataset for Study 2 and run the analyses reported in the manuscript and the SI.

WVS_sample_comp.dta - Dataset combining the demographic data from the World Values Survey wave 6 for Estonia with those from Study 1 and Study 2.
WVS_sample_comp.do - Code to run the comparisons reported in SI.2 and SI.6.

Experimental_instructions_Studies1&2.pdf - The details of the experimental instructions used in Studies 1 and 2.


2. Description of variables 
We list here the variable names, labels, and value labels in the datasets for Study 1 and Study 2. Any additional variables created for the analyses are detailed in the respective do-files. Variables in "WVS_sample_comp.dta" are described in section 3 below, titled "Description of how to generate WVS_sample_comp.dta"

A. Study1_raw.dta

-----------------------------------------------------------------------------------------------------
how_old                                                                              How old are you?
-----------------------------------------------------------------------------------------------------
                 range:  [22,76]                      units:  1
         unique values:  53                       missing .:  0/262

-----------------------------------------------------------------------------------------------------
first_lg                  What is your native language, that is, the first language you ever learned?
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Russian
                                  2  Estonian
                                  3  both Russian and Estonian

-----------------------------------------------------------------------------------------------------
gender                                                           What is your gender, female or male?
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Female
                                  2  Male

-----------------------------------------------------------------------------------------------------
preferred_lg                                   What language do you generally prefer to interview in?
-----------------------------------------------------------------------------------------------------
            tabulation:   Numeric  Label
                                  1  Estonian
                                  2  Russian

-----------------------------------------------------------------------------------------------------
education                                  Which of the following is your highest level of education?
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  2  Primary
                                  3  Secondary or vocational
                                  4  Incomplete university
                                          undergraduate degree
                                  5  Complete university
                                          undergraduate degree or higher

-----------------------------------------------------------------------------------------------------
assigned_lg                                    Estonian language assigned/ Russian language assigned 
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Estonian language assigned
                                  2  Russian language assigned

-----------------------------------------------------------------------------------------------------
issue_a                   Which of these issues do you think is the most important problem facing Est
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Performance of the economy
                                  2  Immigrant and refugee policy
                                  3  Integration of the
                                          Russian-speaking population
                                  4  Unemployment
                                  .  

-----------------------------------------------------------------------------------------------------
issue_b                   Which issue would you rank as the 2nd most important issue after [INSERT IS
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Performance of the economy
                                  2  Immigrant and refugee policy
                                  3  Integration of the
                                          Russian-speaking population
                                  4  Unemployment
                                  .  

-----------------------------------------------------------------------------------------------------
issue_c                   Which issue you rank as the 3nd most important issue after [INSERT ISSUE NA
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Performance of the economy
                                  2  Immigrant and refugee policy
                                  3  Integration of the
                                          Russian-speaking population
                                  4  Unemployment
                                  .  

-----------------------------------------------------------------------------------------------------
issue_d                                                                           THE LEAST IMPORTANT
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Performance of the economy
                                  2  Immigrant and refugee policy
                                  3  Integration of the
                                          Russian-speaking population
                                  4  Unemployment
                                  .  

B. Study2_raw.dta

-----------------------------------------------------------------------------------------------------
how_old                                                                              How old are You?
-----------------------------------------------------------------------------------------------------
                 range:  [18,74]                      units:  1
         unique values:  57                       missing .:  0/1,200

-----------------------------------------------------------------------------------------------------
first_lg                 What is your native language, that is, the first language you ever learned? 
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Russian
                                  2  Estonian
                                  3  As russian as estonian

-----------------------------------------------------------------------------------------------------
gender                                                           What is your gender, female or male?
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Female
                                  2  Male

-----------------------------------------------------------------------------------------------------
preferred_lg                                   What language do you generally prefer to interview in?
-----------------------------------------------------------------------------------------------------
            		 Numeric  Label
                        	1  Estonian
                                2  Russian

-----------------------------------------------------------------------------------------------------
ideol                In politics people sometimes talk of left and right. Where would you place yours
-----------------------------------------------------------------------------------------------------
                 range:  [0,13]                       units:  1
         unique values:  14                       missing .:  0/1,200

     			00 Left
			01
			02
			03
			04
			05
			06
			07
			08
			09
			10 Right
			11 Haven't heard of left-right
			12 Refused
			13 Don't know where to place

-----------------------------------------------------------------------------------------------------
education                                   Which of the following is your highest level of education
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Elementary
                                  2  Primary
                                  3  Secondary or vocational
                                  4  Incomplete university
                                          undergraduate degree
                                  5  Complete university
                                          undergraduate degree or higher

-----------------------------------------------------------------------------------------------------
assigned_lg                                            ASSIGN INTERVIEW LANGUAGE: ESTONIAN OR RUSSIAN
-----------------------------------------------------------------------------------------------------
            tabulation:  Numeric  Label
                                  1  Estonian language assigned
                                  2  Russian language assigned

-----------------------------------------------------------------------------------------------------
parties              In general, thinking about the political parties in Riigikogu, which of the foll
-----------------------------------------------------------------------------------------------------
            tabulation:  Freq.   Numeric  Label
                                  1  Reform Party
                                  2  Center Party
                                  3  Union of Pro Patria and Res
                                          Publica
                                  4  dk



3. Description of how to generate WVS_sample_comp.dta

**************************************************
**Prepare the World Values Survey data
**************************************************

***Download World Values Survey trend file from here: http://www.worldvaluessurvey.org/WVSDocumentationWVL.jsp
***File name: WVS_Longitudinal_1981-2014_stata_dta_v_2015_04_18.dta


**Keep only Estonia
keep if S003==233
***Keep only the latest wave, which is mis proximate to Study 2 (2010-2014)
keep if S002==6
**Keep the relevant demographic variables
keep S001 S002 S003 S007 X001 X003 X025 E033

**Recode variables to match those in Studies 1 and 2

**Education level
***Generate a new "edu" variable using X025 and recode positive values as follows (to correspond with the coding in our bilingual Study 1)
*** 1="inadequately completed elementary education" + "completed elementary education" and corresponds with "elementary" in the bilingual survey
generate edu = .
replace edu = 1 if X025==1
replace edu = 1 if X025==2
*** 2="incomplete secondary school:vocational" + "incomplete secondary: university-prep." and corresponds with "primary school" in the bilingual survey
replace edu = 2 if X025==3
replace edu = 2 if X025==5
*** 3 = "complete secondary school: vocational" + "complete secondary: university-prep." and corresponds with "secondary and vocational" in the bilingual survey
replace edu = 3 if X025==4
replace edu = 3 if X025==6
*** 4= "some university without degree" and corresponds with "incomplete university education" in the bilingual survey
replace edu = 4 if X025==7
*** 5= "university with degree" and corresponds with "complete university" in the bilingual survey
replace edu = 5 if X025==8

**Sex
generate female = .
replace female = 1 if X001==2
replace female = 0 if X001==1

**Age
generate age = X003

**Self-placement
generate ideology = E033
replace ideology = . if E033==-2
replace ideology = . if E033==-1

**Study number
***generate variable that identifies this as Study 6
generate study = S002

**Save new dataset 
save "WVS_Estonia.dta"


*****************************************************
**Prepare Study 1 data
*****************************************************

**Use "Study1_raw.dta"***
keep how_old gender education 

***generate variable that identifies this as Study 1
generate study=1

*** Generate "age"
gen age=how_old 

***Generate "female"
gen female=0
recode female (0=1) if gender==1
tab female

***Generate "education"
gen edu=education

***Generate ideology
generate ideology = .

***Save new dataset
save "Study2_for_WVS.dta"


*****************************************************
**Prepare Study 2 data
*****************************************************
***Use "Study2_raw.dta"
keep how_old gender education ideol

***generate variable that identifies this as Study 2
generate study = 2

*** Generate "age"
gen age=how_old 

***Generate "female"
gen female=0
recode female (0=1) if gender==1
tab female

***Generate "education"
gen edu=education

**Self-placement
generate ideology = ideol
replace ideology = . if ideol==11
replace ideology = . if ideol==12
replace ideology = . if ideol==13

***Save new dataset
save "Study1_for_WVS.dta"


**************************************************
**Create WVS_sample_comp.dta 
**************************************************
use WVS_Estonia.dta
append using "Study1_for_WVS.dta" "Study2_for_WVS.dta", keep(edu female age ideology study)
save "WVS_sample_comp.dta"



